//
//  XMLParser.h
//  OR_1
//
//  Created by Luboš Kulič on 7/30/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//


#import <Foundation/Foundation.h>
#import "XMLParserWorkers.h"

#import "DataItem.h"



typedef NSMutableDictionary ElementParserList;


/**
 General XML parser.
 
 Processes the XML data and when some element starts, it tries to hand over the control to a specific XMLParserWorker. 
 This specific worker then parses a piece of input data and when it finishes, the control is passed back to XMLParser.
 */
@interface XMLParser : XMLParserWorkerArrayData {
	@private 
	DataItem * ORStatement;
}


-(id) init;

// Creates Dictionary structure with Key = shortcut from OR, Value = struct { long_name, content }
// ?? maybe better Array for direct use with table view? - but we will be filtering the list anyway...

// Problem - XML can contain enumeration of more same elements (e.g. firm owners) - for these, we need array
// We also need the hierarchy (at least for some elements) - e.g. every firm owner has its element FO with 
// subelements for name, surname etc.

// probably better solution - "clever" parser - returns array of descriptions, array of owners, etc.
// i.e. it has to know the tags (who else should know XML tags then XML parser?)
-(DataItem *)parse:(NSData *)data;


@end
